<template>
  <div id="homeB">
     <h3>{{msg}}</h3>
    <p>我是父组件传来的信息：{{inputMsg}}</p>
    <input v-model="homeBMsg" type="text"/> <button @click="sendMsg">传给兄弟组件</button>
  </div>
</template>
<script>
  import VueEvent from './VueEvent'

  export default{
      props:["inputMsg"],
      data(){
          return {
              msg:"我是home的子组件homeB",
              homeBMsg:""
          }
      },
      methods:{
        sendMsg(){
            //广播数据（广播的名字，数据）
            VueEvent.$emit("to_homeA",this.homeBMsg);
        }
      }
  }
</script>
<style lang="scss">
  #homeB{
    width: 50%;
    height: 200px;
    outline: solid 0.5px grey;
  }
</style>
